<?php

namespace App\Http\Requests\V3_2_7;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class AgreeRefuseRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'is_agree'=>['required',Rule::in([1,2])],
            'id'=>'required|integer'
        ];
    }

    /**
     * 验证错误信息.
     *
     * @return array
     */
    public function messages(): array
    {
        return [
            'is_agree.required' => '同意或拒绝，参数必传！',
            'is_agree.in' => '同意或拒绝，参数错误！',
            'id.required' => '申请表，主键必传！',
            'id.integer' => '申请表，主键为整数！',
        ];
    }
}
